#
# Copyright 2023 The titan-search Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#    https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

#[[kmcmake_cc_test(
        NAME custom_comparator_test
        SOURCES custom_comparator_test.cc
        DEPS turbo::turbo ${KMCMAKE_DEPS_LINK} ${GTEST_LIB} ${GTEST_MAIN_LIB}
        COPTS ${USER_CXX_FLAGS}
)]]
#[[
kmcmake_cc_test(
        NAME foo_test
        SOURCES foo_test.cc
        DEPS ${PROJECT}::foo ${KMCMAKE_DEPS_LINK} gtest gtest_main
        COPTS ${USER_CXX_FLAGS}
)

kmcmake_cc_test(
        NAME foo_doctest
        SOURCES foo_doctest.cc
        DEPS ${PROJECT}::foo ${KMCMAKE_DEPS_LINK} doctest
        COPTS ${USER_CXX_FLAGS}
)
]]

find_package(KTest REQUIRED)
kmcmake_cc_test(
        NAME benchmark
        MODULE kfor
        SOURCES benchmark.c
        LINKS
        kfor::for_static
)

kmcmake_cc_test(
        NAME test
        MODULE kfor
        SOURCES test.c
        LINKS
        kfor::for_static
)

kmcmake_cc_test(
        NAME array_test
        MODULE kfor
        SOURCES array_test.cc
        LINKS
        kfor::for_static
        KTest::ktest
        KTest::ktest_main
)

kmcmake_cc_test(
        NAME array_utils_test
        MODULE kfor
        SOURCES array_utils_test.cc
        LINKS
        kfor::for_static
        KTest::ktest
        KTest::ktest_main
)

kmcmake_cc_test(
        NAME sorted_array_test
        MODULE kfor
        SOURCES sorted_array_test.cc
        DEFINES
        -DROOT_DIR="${PROJECT_SOURCE_DIR}"
        LINKS
        kfor::for_static
        KTest::ktest
        KTest::ktest_main
)

kmcmake_cc_test(
        NAME id_list_test
        MODULE kfor
        SOURCES id_list_test.cc
        DEFINES
        -DROOT_DIR="${PROJECT_SOURCE_DIR}"
        LINKS
        kfor::for_static
        KTest::ktest
        KTest::ktest_main
)